package com.mrd.gtimp.business.entity;

import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

/**
*  单一窗口报关申报记录
 * Created by dengdc on 2017/5/25.
 */
@Entity(name = "T_BIZ_CARGO_DECLA_RECORD")
public class CargoDeclaRecord implements Serializable{
    /**
     * id Pk
     */
    @Id
    @GeneratedValue(generator = "cargoDeclaRecordGenerator")
    @GenericGenerator(name = "cargoDeclaRecordGenerator", strategy = "uuid")
    private String	id;
    /**
     * 报关单ID
     */
    @Column(name = "DID")
    private String	did;
    /**
     * 业务编码
     */
    @Column(name = "BUSINESS_NO")
    private String	businessNo;
    /**
     * 进出口标识
     */
    @Column(name = "IE_FLAG")
    private String	ieFlag;
    /**
     * 直航转关标识
     */
    @Column(name = "TRN_FLAG")
    private String	trnFlag;
    /**
     * 创建时间
     */
    @Column(name = "CREATE_TIME")
    private Date    cteateTime;
    /**
     * 更新时间
     */
    @Column(name = "UPDATE_TIME")
    private Date	updateTime;
    /**
     * 公司ID
     */
    @Column(name = "COMPANY_ID")
    private String	companyId;
    /**
     报关状态
     * 0 = '初始化'
     * -1 = '上传失败'
     * 1 = '上载中'
     * 2 = '上载成功'
     * 3 = '上载失败'
     * 4 = '暂存'
     * 5 = '申报失败'
     * 6 = '申报中'
     * 8 = '申报成功'
     * 12 = '担保放行'
     * 16 = '报关单审结'
     * 18 = '需交税费'
     * 20 = '海关删单'
     * 21 = '报关单重审'
     * 22 = '结关'
     * 23 = '查验通知'
     * 25 = '报关单放行'
     * 27 = '进港回执'
     * 9 = '海关已接收'
     * 10 = '不被受理'
     * 11 = '需手工申报'
     * 13 = '退回修改'
     * 14 = '放行交单'
     * 28 = '通关无纸化放行'
     * 29 = '通关无纸化审结'
     * 30 = '修撤单需要补传/重传'
     * ------------------------------------
     * ------------------------------------
     * 报关状态 国版单一窗口
     * 0 = '上传中'
     * TS = '暂存'
     * TF = '上传失败'
     * L 海关入库回执
     * E 海关退单/不受理回执
     * G 海关接单交单回执
     * F 海关放行交单回执
     * W 海关无纸验放通知（审结）
     * I 海关无纸放行通知（放行）
     * C 海关无纸验放查验通知书（放行）
     * B 海关担保验放
     * P 海关已放行
     * R 海关已结关回执
     * H 海关挂起，需手工申报
     * M 海关重新审核通过
     * A 海关放行前删除或者异常处理（手工申报通知）
     * D 海关放行后删除
     * X 海关准予进港回执（上海洋山保税港区专用）
     * H（H883） 海关手工申报回执
     * Z（H883） 海关退回修改通知
     * T（H883） 海关税费通知
     * J 通关无纸化审结回执（审结回执一种）
     * N 补传随附单证电子数据
     * K 通关无纸化担保放行
     * 7 申报成功
     * 8 申报失败
     */
    @Column(name = "STATUS")
    private String	status;
    /**
     * 报关单号
     */
    @Column(name = "ENTRY_NO")
    private String	entryNo;
    /**
     * 关检号
     */
    @Column(name = "INV_NO")
    private String	invNo;
    /**
     * 关检密码
     */
    @Column(name = "INV_PWD")
    private String	invPwd;
    /**
     * 上传方式
     * GZ_PORT_HTTPS 广州单一窗口接口对接
     * COM_PORT_FTP 国家单一窗口客户端对接，ftp实现。
     */
    @Column(name = "UPLOAD_WAY")
    private String uploadWay;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public String getBusinessNo() {
        return businessNo;
    }

    public void setBusinessNo(String businessNo) {
        this.businessNo = businessNo;
    }

    public String getIeFlag() {
        return ieFlag;
    }

    public void setIeFlag(String ieFlag) {
        this.ieFlag = ieFlag;
    }

    public String getTrnFlag() {
        return trnFlag;
    }

    public void setTrnFlag(String trnFlag) {
        this.trnFlag = trnFlag;
    }

    public Date getCteateTime() {
        return cteateTime;
    }

    public void setCteateTime(Date cteateTime) {
        this.cteateTime = cteateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getStatus() {
        return status;
    }

    public String getUploadWay() {
        return uploadWay;
    }

    public void setUploadWay(String uploadWay) {
        this.uploadWay = uploadWay;
    }

    /**
     * 报关状态
     * 0 = '初始化'
     * -1 = '上传失败'
     * 1 = '上载中'
     * 2 = '上载成功'
     * 3 = '上载失败'
     * 4 = '暂存'
     * 5 = '申报失败'
     * 6 = '申报中'
     * 8 = '申报成功'
     * 12 = '担保放行'
     * 16 = '报关单审结'
     * 18 = '需交税费'
     * 20 = '海关删单'
     * 21 = '报关单重审'
     * 22 = '结关'
     * 23 = '查验通知'
     * 25 = '报关单放行'
     * 27 = '进港回执'
     * 9 = '海关已接收'
     * 10 = '不被受理'
     * 11 = '需手工申报'
     * 13 = '退回修改'
     * 14 = '放行交单'
     * 28 = '通关无纸化放行'
     * 29 = '通关无纸化审结'
     * 30 = '修撤单需要补传/重传'
     */
    public String getStatusLab() {
        String lab = "";
        switch (this.status){
            case "0":
                lab = "正在上传";
                break;
            case "-1":
                lab = "上传电子口岸失败";
                break;
            case "1":
                lab = "上载中";
                break;
            case "2":
                lab = "上载成功";
                break;
            case "3":
                lab = "上载失败";
                break;
            case "4":
                lab = "暂存";
                break;
            case "5":
                lab = "申报失败";
                break;
            case "6":
                lab = "申报中";
                break;
            case "8":
                lab = "申报成功";
                break;
            case "12":
                lab = "担保放行";
                break;
            case "16":
                lab = "报关单审结";
                break;
            case "18":
                lab = "需交税费";
                break;
            case "20":
                lab = "海关删单";
                break;
            case "21":
                lab = "报关单重审";
                break;
            case "22":
                lab = "结关";
                break;
            case "23":
                lab = "查验通知";
                break;
            case "25":
                lab = "报关单放行";
                break;
            case "27":
                lab = "进港回执";
                break;
            case "9":
                lab = "海关已接收";
                break;
            case "10":
                lab = "不被受理";
                break;
            case "11":
                lab = "需手工申报";
                break;
            case "13":
                lab = "退回修改";
                break;
            case "14":
                lab = "放行交单";
                break;
            case "28":
                lab = "通关无纸化放行";
                break;
            case "29":
                lab = "通关无纸化审结";
                break;
            case "30":
                lab = "修撤单需要补传/重传";
                break;
            default:
        }
        return lab;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getEntryNo() {
        return entryNo;
    }

    public void setEntryNo(String entryNo) {
        this.entryNo = entryNo;
    }

    public String getInvNo() {
        return invNo;
    }

    public void setInvNo(String invNo) {
        this.invNo = invNo;
    }

    public String getInvPwd() {
        return invPwd;
    }

    public void setInvPwd(String invPwd) {
        this.invPwd = invPwd;
    }
}
